#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;

const int kMaxN = 101;

vector<int> ans[kMaxN];
int now[kMaxN] = {1};
int used[kMaxN][kMaxN], flag = 0;
int ans_len, n;

bool DFS(int dep, int len) {
  if ((now[dep - 1] << (len - dep)) < n) {
    return false;
  }

  if (dep == len) {
    for (int i = 0; i < len; i++) {
      ans[n].push_back(now[i]);
    }
    return true;
  }

  int id = ++flag;
  for (int i = dep - 1; i >= 0; i--) {
    for (int j = i; j >= 0; j--) {
      if (now[i] + now[j] <= n && now[i] + now[j] > now[dep - 1] && used[dep][now[i] + now[j]] != id) {
        now[dep] = now[i] + now[j];
        used[dep][now[i] + now[j]] = id;
        if (DFS(dep + 1, len)) {
          return true;
        }
      }
    }
  }
  return false;
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

  for (cin >> n; n; cin >> n) {
    if (ans[n].empty()) {
      for (ans_len = 1; !DFS(1, ans_len); ans_len++);
    }
    for (int num : ans[n]) {
      cout << num << ' ';
    }
    cout << endl;
  }
  return 0;
}